package com.dy.lock.screen.api.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;

import com.dy.lock.screen.api.constants.Constant;
import com.dy.lock.screen.api.utils.CommonUtil;
import com.dy.lock.screen.api.utils.ServletUtil;
import com.dy.lock.screen.api.vo.ResultVo;
import com.google.gson.Gson;

/**
 * 
 * @description 新手教程
 * @author
 * @date
 */
public class NewbiesTutorialServlet extends SuperServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@SuppressWarnings("unused")
	private static Logger log = Logger.getLogger(NewbiesTutorialServlet.class);
	private static Gson gson = CommonUtil.gson();

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doPost(req, resp);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		req.setAttribute("org.eclipse.jetty.server.Request.queryEncoding",
				"UTF-8");
		resp.setContentType("text/html;charset=UTF-8");
		resp.setStatus(HttpServletResponse.SC_OK);

		ResultVo ri = new ResultVo();
		ri.setCode(Constant.SUCCESS);
		ri.setStatus(Constant.TRUE);
		ri.setData("http://www.baidu.com");
		ServletUtil.writeResJsonStr(resp, gson.toJson(ri));
	}

}
